VERSION=0.3.0b
DOCKER_IMAGE=registry.cn-wulanchabu.aliyuncs.com/baco3/baco3-app:${VERSION}
DOCKER_IMAGE_BASE=registry.cn-wulanchabu.aliyuncs.com/baco3/baco3-app:base-py312

docker_base:
	docker build -t $(DOCKER_IMAGE_BASE) -f Dockerfile.base .

docker_clean:
	docker stop baco3
	docker rm baco3
docker:
	docker build -t $(DOCKER_IMAGE) .

docker_up: docker
	# Must ensure that $(shell pwd)/docker_instance exists
	docker run -it --name baco3  --network host \
	 -v /docker_containers_shared:/docker_containers_shared \
	 -v /var/run/docker.sock:/var/run/docker.sock \
	 -v $(shell pwd)/docker_instance:$(shell pwd)/docker_instance \
	 -e LOCAL_INSTANCE_DATA_PATH=$(shell pwd)/docker_instance \
	  $(DOCKER_IMAGE)

docker_run:
	# Must ensure that $(shell pwd)/docker_instance exists
	docker run -it --name baco3  --network host \
	 -v /docker_containers_shared:/docker_containers_shared \
	 -v /var/run/docker.sock:/var/run/docker.sock \
	 -v $(shell pwd)/docker_instance:$(shell pwd)/docker_instance \
	 -e LOCAL_INSTANCE_DATA_PATH=$(shell pwd)/docker_instance \
	  $(DOCKER_IMAGE)

docker_run_bg: 
	# Must ensure that $(shell pwd)/docker_instance exists
	docker run -itd --name baco3 --network host \
	 -v /docker_containers_shared:/docker_containers_shared \
	 -v /var/run/docker.sock:/var/run/docker.sock \
	 -v $(shell pwd)/docker_instance:$(shell pwd)/docker_instance \
	 -e LOCAL_INSTANCE_DATA_PATH=$(shell pwd)/docker_instance \
	  $(DOCKER_IMAGE)